package com.hexinfo.dmpro.admin.model;

import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * @ClassName Role
 * @Describe
 * @Author ml.wang
 * @Date 2021-06-17
 */
@Data
public class Role implements Serializable {

    private Long id;

    private String name;

    private String remark;

    /**
     * 数值越小，级别越大
     */
    private Integer level;

    /**
     * 权限
     */
    private String permission;

    private Timestamp createTime;

    /**
     * 角色类型
     */
    private String type;

    private Set<User> users;

    private Set<Menu> menus;

    //发布权限角色
    private List<String> usernameList;
    //git路径
    private List<String> gitIdList;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Role role = (Role) o;
        return Objects.equals(id, role.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

}
